package de.hsb.ai.devil.agent;

/**
 * RandomPlayerAgent always returns random values. 
 */
@SuppressWarnings("serial")
public class RandomPlayerAgent extends AbstractDevilPlayer {
	
	public RandomPlayerAgent() {
		super("random");
	}
	
	/**
	 * Returns a random delta.
	 * @return a value {@code x} where 1 &le; {@code x} &le; 3
	 */
	@Override
	public int getDelta(int total) {
		return (int) Math.round(Math.random() * (total > 2 ? 2 : total)) + 1;
	}
}
